﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.TeamFoundation.VersionControl.Client;

namespace PSE.Deployment.TeamFoundation.Translator
{
    public static class TeamProjectTranslator
    {
        public static List<Entity.TeamProject> TranslateToEntity(TeamProject[] tsf)
        {
            List<Entity.TeamProject> translation = new List<Entity.TeamProject>();

            foreach (TeamProject tp in tsf)
            {
                try
                {
                    Entity.TeamProject teamProject = new PSE.Deployment.TeamFoundation.Entity.TeamProject();
                    teamProject.Name = tp.Name;
                    teamProject.ServerItem = tp.ServerItem;
                    teamProject.Uri = tp.ArtifactUri.ToString();

                    translation.Add(teamProject);
                }
                catch (Exception)
                {
                    
                }
            }

            return translation;
        }
    }
}
